//
//  LMViewController.m
//  LM
//
//  Created by Kien Tran on 1/18/13.
//  Copyright (c) 2013 Kien Tran. All rights reserved.
//

#import "LMViewController.h"
#import "LMConstant.h"
#import "LMHeartButton.h"

@interface LMViewController () {
    UIButton *_plusButton;
    UIButton *_minusButton;
}

@end

@implementation LMViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    [self.view setBackgroundColor:[UIColor clearColor]];
    
    // bottom button
    UIImage *plus = [UIImage imageNamed:kIMAGE_BG_PLUS];
    UIImage *activePlus = [UIImage imageNamed:kIMAGE_BG_PLUS_ACTIVE];
    
    UIImage *minus = [UIImage imageNamed:kIMAGE_BG_MINUS];
    UIImage *activeMinus = [UIImage imageNamed:kIMAGE_BG_MINUS_ACTIVE];
    
    _plusButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_plusButton setImage:plus forState:UIControlStateNormal];
    [_plusButton setImage:activePlus forState:UIControlStateSelected];
    
    _minusButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_minusButton setImage:minus forState:UIControlStateNormal];
    [_minusButton setImage:activeMinus forState:UIControlStateSelected];
    
    
    CGRect plusRect = CGRectMake(0, self.view.frame.size.height - 28 - self.navigationController.navigationBar.frame.size.height, plus.size.width, plus.size.height);
    _plusButton.frame = plusRect;
    
    CGRect minusRect = CGRectMake(155, self.view.frame.size.height - 28 - self.navigationController.navigationBar.frame.size.height, minus.size.width, minus.size.height);
    _minusButton.frame = minusRect;
    
    [self.view addSubview:_plusButton];
    [self.view addSubview:_minusButton];

}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    
//    CGRect rect = [self.view frame];
//    rect.origin.y = self.tabBarController.tabBar.frame.size.height + [UIApplication sharedApplication].statusBarFrame.size.height + 50;
//    rect.size.height = self.view.frame.size.height - rect.origin.y;
//    
//    self.view.frame = rect;
//    
//    rect = self.view.frame;
//    rect.origin.y = 226;
//    self.view.frame = rect;
}
- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    
    
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

- (IBAction)touch:(id)sender {
}
@end
